package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.PreferenceDTO;
import com.startup.yellocar.dao.PreferenceDAO;

import com.startup.yellocar.service.PreferenceService;

@Service
@Transactional
public class PreferenceServiceImpl implements PreferenceService {

	@Autowired
	protected PreferenceDAO preferenceDAO;

	@Transactional
	public void insert(PreferenceDTO preferenceDTO){
		preferenceDAO.insert(preferenceDTO);
	}

	@Transactional
	public void update(PreferenceDTO preferenceDTO){
		preferenceDAO.update(preferenceDTO);
	}

	@Transactional
	public PreferenceDTO get(int id) {
		return preferenceDAO.get(id);
	}

	@Transactional
	public List<PreferenceDTO> getAll() {
		return preferenceDAO.getAll();
	}

	@Transactional
	public void delete(PreferenceDTO preferenceDTO){
		preferenceDAO.delete(preferenceDTO);
	}

}
